package com.gjzhao.fmmall.service.impl;

import com.gjzhao.fmmall.service.BrandService;
import com.gjzhao.fmmall.utils.AssertUtil;
import com.gjzhao.fmmall.vo.BrandVO;
import com.gjzhao.fmmall.vo.RespResultVO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

/**
 * @Description: 品牌业务 ServiceImpl
 * @Author: gjzhao
 * @Date Created in 2022-01-24 10:30 上午
 */
@Service
public class BrandServiceImpl implements BrandService {

    protected Logger logger = LoggerFactory.getLogger(getClass());



    /**
     * 添加品牌(测试 @Validated 参数校验功能)
     * @param brand
     */
    @Override
    public RespResultVO addByValidated(BrandVO brand) {

        logger.info("---商品信息:{}",brand);

        return RespResultVO.success(brand);
    }


    /**
     * 添加品牌(测试 ApiException 全局异常功能)
     * @param brand
     */
    @Override
    public void addByGlobalException(BrandVO brand) {

        logger.info("---商品信息:{}",brand);

        //查询商品品牌已存在
        AssertUtil.fail("商品品牌已存在");
    }


}
